#ifndef DISKPAGE_H
#define DISKPAGE_H

#include "stdafx.h"
#include "Record.h"
#include "ArbRecord.h"

using namespace std;

const int pagesize = 1024;

class Diskpage
{
      private:
              char *filename; //Filename of Destination
			  int skipIndex; //Index for the starting record in the DiskPage
			  int writeIndex; //Index for writing a DiskPage
              Record Rlist[7]; //List of Records Before converted to raw form
			  ArbRecord Alist[7]; //Integrating a record object that can hold any data.
      public:
             char* readHeader();
			 int writeHeader(Node nodes[100]);
             void setRlist(int i, Record R);
			 void setAlist(int i, ArbRecord AR);
			 Diskpage(char *name, int index);
			 Diskpage();
			 void setFileName(char *name){filename=name;}
			 void setSkipIndex(int index){skipIndex=index;}
			 int getSkipIndex(){return skipIndex;}
			 char *getFileName(){return filename;}
             int writedp();
			 int readdp(int header_count, int header_length, int record_length, Node header_nodes[100]);
             ArbRecord find(int n, int header_count, int header_length, int record_length, Node header_nodes[100]);
			 bool isFull();
			 void empty();
			 ofstream outRecord;
};

#endif
